<%@ include file="../common/top.jsp" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<div id="Catalog">
    <div id="item_box">
        <div>
            <br>
            <br>
            <img id="item_pic" src="${sessionScope.product.description}">
        </div>
        <div id="item_att">
            <br>
            <h2>
                ${sessionScope.product.name}&ensp;${sessionScope.item.itemId}
            </h2>
            <br>
                <div>${sessionScope.item.attribute1}，
                    ${sessionScope.item.attribute2}</div>
                <div>${sessionScope.item.attribute3}</div>
                <div>${sessionScope.item.attribute4}，
                ${sessionScope.item.attribute5}</div>
            <br>
            <c:if test="${sessionScope.item.quantity <= 0}">
                Back ordered.
            </c:if>
            <c:if test="${sessionScope.item.quantity > 0}">
                ${sessionScope.item.quantity} in stock.
            </c:if>
            <br><b>
            <fmt:formatNumber value="${sessionScope.item.listPrice}" pattern="$#,##0.00"/></b>
            <br>
            <br>
            <br>
            <!--flag session和request的定义是避免刷新自增用的 -->
            <%session.setAttribute("flag", 1);%>
            <a href="addItemToCart?workingItemId=${sessionScope.item.itemId}&flag=1" class="Button">Add to Cart</a>
            <br>
            <br>
            <br>
            <div id="BackLink">
                <a href="productForm?productId=${sessionScope.product.productId}">
                    回到${sessionScope.product.productId}
                </a>
            </div>
        </div>
    </div>
</div>


<%@ include file="../common/bottom.jsp" %>



